package com.itheima.controller.order;

import com.itheima.api.order.CmsPrefrenceAreaService;
import com.itheima.vo.domain.AjaxResult;
import com.itheima.vo.pojo.CmsPrefrenceArea;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/prefrenceArea")
@Slf4j
public class CmsPrefrenceAreaController {

    @DubboReference
    private CmsPrefrenceAreaService areaService;

    /**
     * 获取所有商品优选
     * @return
     */
    @GetMapping("/listAll")
    public AjaxResult listAll(){
        List<CmsPrefrenceArea> list = areaService.list();
        return AjaxResult.success(list);
    }
}
